Skip to content

improvement(files): show loading spinner in file preview content area#5610

Merged
waleedlatif1 merged 1 commit into
stagingfrom
improvement/file-preview-loading-spinner
Jul 12, 2026
Merged

improvement(files): show loading spinner in file preview content area#5610
waleedlatif1 merged 1 commit into
stagingfrom
improvement/file-preview-loading-spinner

Conversation

@waleedlatif1

Copy link
Copy Markdown
Collaborator

Summary

  • File previews (public share pages and the in-app viewer) showed a blank content area while content loaded — added the app's standard Loader spinner so users know content is coming
  • Added the spinner to the two shared loading primitives (PreviewLoadingFrame, PREVIEW_LOADING_OVERLAY) that every preview renderer (text, markdown, PDF, docx, pptx, xlsx, csv, audio/video) already funnels through, so all file types get it from one change
  • Image previews had no loading state at all (blank until the <img> decoded) — added a load-settled overlay driven by onLoad/onError

Type of Change

  • Improvement

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel

vercel Bot commented Jul 12, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
docs Skipped Skipped Jul 12, 2026 12:24am

Request Review

@cursor

cursor Bot commented Jul 12, 2026

Copy link
Copy Markdown

PR Summary

Low Risk
UI-only loading feedback in the file viewer; no auth, data, or API behavior changes.

Overview
File previews no longer show a blank content area while loading — shared loading UI now uses the app-standard Loader spinner instead of empty placeholders.

PreviewLoadingFrame and PREVIEW_LOADING_OVERLAY in preview-shared.tsx were updated to center the same spinner on the preview canvas, so every preview type that already uses those primitives (text, markdown, PDF, office formats, CSV, etc.) picks up the behavior without per-format changes.

Image previews get an explicit load-settled state: hasSettled clears PREVIEW_LOADING_OVERLAY on onLoad or onError, covering the gap where the <img> decoded with no feedback before.

Reviewed by Cursor Bugbot for commit 2d981c5. Configure here.

@greptile-apps

greptile-apps Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds visible loading indicators to file preview surfaces. The main changes are:

  • Shared preview loading frames now show the standard spinner.
  • Shared preview overlays now center the same spinner over preview canvases.
  • Image previews now show the overlay until the image load or error event settles.

Confidence Score: 5/5

This looks safe to merge.

  • No blocking issues found in the changed code.

Important Files Changed

Filename Overview
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/image-preview.tsx Adds image-preview settled state and an initial loading overlay.
apps/sim/app/workspace/[workspaceId]/files/components/file-viewer/preview-shared.tsx Adds the shared spinner to preview loading primitives.

Reviews (4): Last reviewed commit: "improvement(files): show loading spinner..." | Re-trigger Greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2d981c5. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 2d981c5. Configure here.

@waleedlatif1

Copy link
Copy Markdown
Collaborator Author

@greptile

@waleedlatif1 waleedlatif1 merged commit 83c532c into staging Jul 12, 2026
18 checks passed
@waleedlatif1 waleedlatif1 deleted the improvement/file-preview-loading-spinner branch July 12, 2026 00:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant